package self.niu.com.resume.db.dao.impl;

import com.lidroid.xutils.DbUtils;
import com.lidroid.xutils.exception.DbException;
import java.util.List;
import self.niu.com.resume.AppBase;
import self.niu.com.resume.db.SkilledAbility;
import self.niu.com.resume.db.dao.SkilledAbilityDao;

/**
 * Created by Administrator on 2015/9/27 0027.
 */
public class SkilledAbilityDaoImpl implements SkilledAbilityDao {
    private DbUtils db;

    public SkilledAbilityDaoImpl() {
        this.db = AppBase.db;
    }

    @Override
    public void update(SkilledAbility skilled, String numberCusor) {

    }

    @Override
    public void save(SkilledAbility skilled) {
        try {
            db.save(skilled);
        } catch (DbException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void deleteById(int id) {

    }

    @Override
    public SkilledAbility find(String name) {
        return null;
    }

    @Override
    public List<SkilledAbility> findAll() {
        List<SkilledAbility> list = null;
        try {
            list = db.findAll(SkilledAbility.class);
        } catch (DbException e) {
            e.printStackTrace();
        }
        return list;
    }

    @Override
    public void createDb(Class t) {
        try {
            db.createTableIfNotExist(t);
        } catch (DbException e) {
            e.printStackTrace();
        }
    }
}
